package com.example.ItPhotoAlbumCloud.utils;


/**
 * 公用的自定义异常
 *  小仙 创建人 2023-03-12 08:54:11.
 */
public class CommonException extends RuntimeException {

    /** 错误描述 */
    private String errorMsg;
    /** 错误编码 */
    private String errorCode;

    public CommonException(String errorMsg) {
        super(errorMsg);
        this.errorMsg = errorMsg;
    }

    public CommonException(String errorMsg, String code) {
        super(errorMsg);
        this.errorMsg = errorMsg;
        this.errorCode = code;
    }

    public CommonException(String msg, Throwable cause) {
        super(msg, cause);
        this.errorMsg = msg;
    }

    public CommonException(String msg, String code, Throwable cause) {
        super(msg, cause);
        this.errorMsg = msg;
        this.errorCode = code;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }
}

